package org.example.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.system.dao.SysResourceDao;
import org.example.system.entity.SysResource;
import org.example.system.service.ISysResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 菜单管理 服务实现类
 * </p>
 *
 * @author LiJunYi
 * @since 2020-05-25
 */
@Service
public class SysResourceServiceImpl extends ServiceImpl<SysResourceDao, SysResource> implements ISysResourceService {

    @Autowired
    SysResourceDao sysResourceDao;

    /**
     * 获取菜单许可通过用户id
     *
     * @param userId id
     * @return {@link List}<{@link SysResource}>
     */
    @Override
    public List<SysResource> getMenuPermissionByUserId(Long userId)
    {
        return sysResourceDao.listResourceByUserId(userId);
    }
}
